$OpenBSD: patch-plugins_node_d_openbsd_systat_in,v 1.2 2012/10/12 09:46:46 kirby Exp $
--- plugins/node.d.openbsd/systat.in.orig	Fri Aug 31 19:22:50 2012
+++ plugins/node.d.openbsd/systat.in	Sun Sep 30 23:26:49 2012
@@ -8,7 +8,7 @@
 #%# family=auto
 #%# capabilities=autoconf
 
-sysctl='/sbin/sysctl'
+sysctl='/usr/bin/vmstat'
 
 if [ "$logarithmic" ]; then
     graph_args="--logarithmic --units=si"
@@ -49,7 +49,7 @@ EOF
 	    exit 0
 	fi
 	ostype=`uname -s`
-	if [ ${ostype} = "FreeBSD" ]; then
+	if [ ${ostype} = "OpenBSD" ]; then
 	    echo "yes"
 	    exit 0
 	fi
@@ -61,13 +61,12 @@ EOF
 	;;
 esac
 
-${sysctl} vm.stats.sys.v_soft vm.stats.sys.v_intr vm.stats.sys.v_syscall vm.stats.sys.v_trap vm.stats.sys.v_swtch \
-    vm.stats.vm.v_forks vm.stats.vm.v_rforks vm.stats.vm.v_vforks | awk '
+vmstat -s | awk '
 BEGIN {forks=0;}
-/^vm.stats.sys.v_soft/{print "softint.value",$2}
-/^vm.stats.sys.v_intr/{print "hardint.value",$2}
-/^vm.stats.sys.v_syscall/{print "syscall.value",$2}
-/^vm.stats.sys.v_swtch/{print "cs.value",$2}
-/^vm.stats.vm.v_[rv]?forks/ {forks+=$2}
+/^[ 0-9]*software interrupts/{print "softint.value",$1}
+/^[ 0-9]*interrupts/{print "hardint.value",$1}
+/^[ 0-9]*syscalls/{print "syscall.value",$1}
+/^[ 0-9]*cpu context switches/{print "cs.value",$1}
+/^[ 0-9]*forks/ {forks+=$1}
 END {print "forks.value",forks;}
 '
